<script setup>
import { ref, onMounted } from 'vue'
import { getBannersApi } from '@/api/home'
const bannerList = ref([])
const getBannerList = async () => {
  const res = await getBannersApi(0)
  bannerList.value = res.data
}

onMounted(() => getBannerList())
</script>

<template>
  <div class="home-banner">
    <el-carousel height="320px">
      <el-carousel-item v-for="item in bannerList" :key="item.id">
        <img object-fit :src="item.picture" alt="" />
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<style scoped lang="scss">
.home-banner {
  width: 100%;
  height: 320px;

  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}
</style>
